import { useState,useCallback } from 'react';
import ReactMemoChild from './RectMemoChild'
function ReactMemo() {
 const [counter,setCounter] =  useState(1)
 const testFun = ()=>{
    console.log('testFun');
 }
  const cb  = useCallback(testFun,[])

//  console.log('counter',counter);
    return ( 
        <>
        {<ReactMemoChild 
            name={'afn'}
            age={28}
            callback={cb}
        />
        }
        <p>
            <button onClick={()=>setCounter(pre=>pre+1)}>counter</button>
        </p>
        </>
     );
}

export default ReactMemo;